package com.wdc.patterns.decorator;

public class Client {
    public static void main(String[] args) {
        //点一份炒饭
        FastFood firedRice = new FiredRice();
        System.out.println(firedRice.getDesc() + " " + firedRice.cost() + "元");
        System.out.println("======================================");
        //再上面的炒饭中加一个鸡蛋
        firedRice = new Egg(firedRice);
        System.out.println(firedRice.getDesc() + " " + firedRice.cost() + "元");

        System.out.println("======================================");
        //在加一个鸡蛋
        firedRice = new Egg(firedRice);
        System.out.println(firedRice.getDesc() + " " + firedRice.cost() + "元");

        System.out.println("======================================");
        firedRice = new Bacon(firedRice);
        System.out.println(firedRice.getDesc() + " " + firedRice.cost() + "元");


    }
}
